﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DLL;
using Module;

namespace BLL
{
    public class BNews
    {
        #region 字段

        private DNews APP = new DNews();//数据操作对象
        private static BNews instance;

        #endregion

        #region 公共接口

        /// <summary>
        /// 取得
        /// </summary>
        /// <returns>BNews对象</returns>
        public static BNews getInstance()
        {
            if (instance == null)
            {
                instance = new BNews();
            }
            return instance;
        }

         /// <summary>
        /// 获取所有可用的新闻
        /// </summary>
        /// <returns></returns>
        public List<NewsModel> GetAllNews()
        {
            return APP.GetAllNews();
        }
         /// <summary>
        /// 根据NewsType获取新闻
        /// </summary>
        /// <param name="newsType"></param>
        /// <returns></returns>
        public List<NewsModel> GetAllNewsByNewsType(int newsType)
        {
            if (newsType < 1)
                return null;
            return APP.GetAllNewsByNewsType(newsType);
        }
        #endregion
    }
}
